const Router = require('koa-router');
const router = new Router();
const {db, Op, QueryTypes} = require("../../models/db");
router.post('/app/psGoods', async ctx => {
    let body= ctx.request.body
    let username = body.username
    let model = await db.models['admin'].findOne({
        where: {
            username
        }
    })
    if (model) {
        let tenantId = model.tenantId
        let list = await db.models['psGoods'].findAll({
            where: {
                tenantId
            }
        })
        return ctx.suc('', list)
    }
    return ctx.suc('', [])
})


module.exports = router;